import pyautogui as pyg
from PIL  import ImageGrab
x, y = pyg.size()
img = pyg.screenshot()
img.save("a.png")

img2 = ImageGrab.grab()
img2.save("b.png")